home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Amiga Tools 2
/
Amiga Tools 2.iso
/
tools
/
mg
/
src.lzh
/
amiga
/
Makefile.LATTICE
< prev
next >
Wrap
Makefile
|
1990-05-23
|
4KB
|
112 lines
#
# Makefile for mg3 and beyond, for use with Lattice v5 and beyond. Uses make
# to build things.
#
# Names of the directories where we find sources
MG = /mg
AMIGA = /amiga
#
# set things up so we get .o files built correctly
#
INCS = -I$(AMIGA) -I/h
CFLAGS = $(INCS) -O
.DEFAULT:
$(CC) $(CFLAGS) -c $*.c
.c.o:
$(CC) $(CFLAGS) -c $*.c
# list of amiga-specific source files
AMIGASRC1 = /amiga/ttymouse.c /amiga/ttymenu.c /amiga/menustack.c \
/amiga/iconify.c /amiga/ttyicon.c /amiga/spawn.c /amiga/offset.c
AMIGASRC2 =/amiga/ttyio.c /amiga/tty.c /amiga/ttykbd.c /amiga/fileio.c \
/amiga/console.c /amiga/dirio.c /amiga/rexx.c
# list of mg system-independent source files
MGSRC1 = /mg/macro.c /mg/regex.c /mg/re_search.c /mg/dired.c /mg/basic.c \
/mg/dir.c /mg/file.c /mg/line.c /mg/match.c /mg/paragraph.c \
/mg/random.c /mg/region.c /mg/search.c /mg/version.c /mg/window.c
MGSRC2 = /mg/word.c /mg/buffer.c /mg/display.c /mg/echo.c /mg/extend.c \
/mg/help.c /mg/kbd.c /mg/keymap.c /mg/main.c /mg/modes.c /mg/cinfo.c \
/mg/bind.c /mg/alloca.c
# list of amiga-specific object files
AMIGAOBJ = ttymouse.o ttymenu.o menustack.o iconify.o ttyicon.o spawn.o \
ttyio.o tty.o ttykbd.o fileio.o console.o dirio.o offset.o rexx.o
# list of mg objects
MGOBJ1 = macro.o regex.o re_search.o dired.o basic.o dir.o file.o line.o \
match.o paragraph.o random.o region.o search.o version.o window.o
MGOBJ2 = word.o buffer.o display.o echo.o extend.o help.o kbd.o keymap.o \
main.o modes.o bind.o cinfo.o alloca.o
OBJ = $(MGOBJ1) $(MGOBJ2) $(AMIGAOBJ)
#
# The editor
#
xmg: $(OBJ) tmp.lnk
blink with tmp.lnk
tmp.lnk: Makefile
echo "From lib:cres.o $(AMIGAOBJ) " noline > tmp.lnk1
echo "$(MGOBJ1) " noline > tmp.lnk2
echo "$(MGOBJ2) $(REXXOBJ) " noline > tmp.lnk3
echo "to xmg lib lib:lcr.lib lib:amiga.lib map nil:" > tmp.lnk4
echo "SMALLCODE SMALLDATA NODEBUG" > tmp.lnk5
echo "DEFINE @_main=@_tinymain" > tmp.lnk6
join tmp.lnk1 tmp.lnk2 tmp.lnk3 tmp.lnk4 tmp.lnk5 tmp.lnk6 as tmp.lnk
rm tmp.lnk?
clean:
-rm $(AMIGAOBJ)
-rm $(MGOBJ1)
-rm $(MGOBJ2)
-rm xmg tmp.lnk rexxobj.make
#
# build the dependency list for the .h files used by all sources. We do
# this in multiple passes so to avoid problems with the long command line
# generate when you slap all the sources together.
# Note that there are faster, but more environment-dependent, ways to do
# turn the output of the makemake's into an lmkfile. We avoid those
# on purpose.
#
depend: rexxobj.make
@echo "Making dependencies. The following include files will be missing:"
@echo "config.h lisp.h syntax.h"
@makemake >ram:mg-amg1 $(INCS) $(AMIGASRC1)
-@grep -v : ram:mg-amg1
@makemake >ram:mg-amg2 $(INCS) $(AMIGASRC2)
-@grep -v : ram:mg-amg2
@makemake >ram:mg-mg1 $(INCS) $(MGSRC1)
-@grep -v : ram:mg-mg1
@makemake >ram:mg-mg2 $(INCS) $(MGSRC2)
-@grep -v : ram:mg-mg2
-@grep >ram:mgx-amg1 : ram:mg-amg1
-@grep >ram:mgx-amg2 : ram:mg-amg2
-@grep >ram:mgx-mg1 : ram:mg-mg1
-@grep >ram:mgx-mg2 : ram:mg-mg2
@delete ram:mg-mg1 ram:mg-mg2 ram:mg-amg1 ram:mg-amg2
@join rexxobj.make /amiga/makefile.LATTICE \
ram:mgx-mg1 ram:mgx-mg2 ram:mgx-amg1 ram:mgx-amg2 \
as makefile
@delete ram:mgx-mg1 ram:mgx-mg2 ram:mgx-amg1 ram:mgx-amg2
# This extracts the value of the REXX define (which should be where the
# binaries are) to set a variable in the Makefile so the linker can
# find them.
rexxobj.make: rexx.h
@echo "Creating rexxobj.make"
@echo >ram:editcoms "M1;E/\#define REXX/REXXOBJ =/;Q"
-@edit from rexx.h to rexxobj.make with ram:editcoms
@delete ram:editcoms
# file dependencies will be appended after this line by "make depend"